<%@ page import="t_4s.Admin" %>
<%@ page import="t_4s.AdminDao" %>
<%@ page import="t_4s.AdminDaolmpl" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/9/7
  Time: 15:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>

<body>
<%
    request.setCharacterEncoding("UTF-8");
    //拿到用户要注册的信息
    String name=request.getParameter("userName");
    String pwd=request.getParameter("pwd");
    Admin admin=new Admin(name,pwd);
    //调用后台方法 实现入库
    AdminDao adminDao=new AdminDaolmpl();
    int count=adminDao.xz(admin);
    //根据入库结果 提示用户
    if (count>0){
        //跳转到登入页面
        request.getRequestDispatcher("login.jsp").forward(request,response);
    }else {
        request.getRequestDispatcher("zc.jsp").forward(request,response);
    }
%>

</body>
</html>
